<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .father {
        position: relative;
        width: 200px;
        height: 200px;
        background-color: #087;
        margin: 100px auto;
      }
      .son {
        position: absolute;
        top: 5px;
        right: 8px;
      }
    </style>
  </head>
  <body>
    <div class="father">
      <div class="son">X</div>
    </div>

    <script>
      const son = document.querySelector('.son');
      const father = document.querySelector('.father');
      son.addEventListener('click',function () {
        father.style.display = 'none'
      })
    </script>
  </body>
</html>